package com.sky.mapper;

import com.sky.annotation.AutoFill;
import com.sky.dto.SetmealPageQueryDTO;
import com.sky.entity.Setmeal;
import com.sky.enumeration.OperationType;
import com.sky.vo.SetmealVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @author zcf
 */
@Mapper
public interface SetmealMapper {
    List<Long> selectByDishId(List<Long> ids);

    @AutoFill(OperationType.INSERT)
    void insert(Setmeal setmeal);

    List<Setmeal> pageQuery(SetmealPageQueryDTO setmealPageQueryDTO);

    @Select("select * from setmeal where id = #{id}")
    Setmeal getById(Long id);

    void deleteByIds(List<Long> ids);

    SetmealVO getByDishID(Long id);

    //修改整个套餐表

    void update(Setmeal setmeal);

    @Select("select count(*) from setmeal where status = #{status}")
    Integer getByStatus(Integer disable);
}
